



var objectIdToSlideDown = false;

var subham_activeId = false;

var subham_slideInProgress = false;

//function showHideContent(e,inputId,newmericid)

function showHideContent(inputId)

{

	//alert('---'+inputId)

	//alert(document.getElementById('image_change'+inputId))

	if(document.getElementById('image_change'+inputId) != null && document.getElementById("displayIDHOLd") != null)

	{

		var TEMPholDHIddenVAlue=document.getElementById("displayIDHOLd").value;

		var TOTALstring=document.getElementById('image_change'+inputId).src;

		//alert(TEMPholDHIddenVAlue)

		if(document.getElementById('image_change'+TEMPholDHIddenVAlue) != null)

		{

			var TOTALstring1=document.getElementById('image_change'+TEMPholDHIddenVAlue).src;

			//alert(document.getElementById("displayIDHOLd").value);

			if(TEMPholDHIddenVAlue != inputId)

			{

				//alert(TOTALstring1.search('images/Show.png'));

				//alert(TOTALstring1.search('Show'));

				

				//alert(TOTALstring1);

				//alert(TOTALstring1.search('Hide'))

				if(TOTALstring1.search('Hide') < 0)

				{

					document.getElementById('image_change'+TEMPholDHIddenVAlue).src = 'images/Hide.png';//'images/Show.png';

					document.getElementById('image_change'+TEMPholDHIddenVAlue).name="Hide";

				}

				else

				{

					document.getElementById('image_change'+TEMPholDHIddenVAlue).src = 'images/Show.png';//'images/Hide.png';

					document.getElementById('image_change'+TEMPholDHIddenVAlue).name="Show";

				}

				

			}

			else

			{

				document.getElementById("displayIDHOLd").value=0;

			}

		}

		//alert(TOTALstring.search('images/Show.png'))

		if(TOTALstring.search('Show') < 0)

		{

			document.getElementById('image_change'+inputId).src = 'images/Show.png';

			document.getElementById('image_change'+inputId).name="Hide";

			document.getElementById("displayIDHOLd").value='';

		}

		else

		{

			document.getElementById('image_change'+inputId).src = 'images/Hide.png';

			document.getElementById('image_change'+inputId).name="Show";

			document.getElementById("displayIDHOLd").value=inputId;

		}



	}

	if(document.getElementById("displayIDHOLd") != null)

	{

		var TEMPholdId=document.getElementById("displayIDHOLd").value;

		if(document.getElementById('image_change'+TEMPholdId) != null)

		{

			//alert(document.getElementById('image_change'+inputId).src);

			var TOTALstring1=document.getElementById('image_change'+TEMPholdId).src;

			//alert(TOTALstring1.search('images/Hide.png'));

			if(TOTALstring1.search('Hide') < 0)

			{

				document.getElementById('image_change'+inputId).src = 'images/Show.png';

				document.getElementById('image_change'+inputId).name="Hide";

			}

		}		

	}

	

	if(subham_slideInProgress)return;

	subham_slideInProgress = true;

	if(!inputId)inputId = this.id;

	//alert(inputId)

	inputId = inputId + '';

	var numericId = inputId.replace(/[^0-9]/g,'');

	var answerDiv = document.getElementById('subham_a' + numericId);

	//var answerDiv1 = document.getElementById('subham_ab' + numericId);

	objectIdToSlideDown = false;

	

	if(!answerDiv.style.display || answerDiv.style.display=='none'){		

		if(subham_activeId &&  subham_activeId!=numericId){			

			objectIdToSlideDown = numericId;

			slideContent(subham_activeId,(subham_slideSpeed*-1));

		}else{

			//alert("sadasdasd");

			answerDiv.style.display='block';

			answerDiv.style.visibility = 'visible';

			

			slideContent(numericId,subham_slideSpeed);

		}

	}else{

			//alert("sadasdasd");

		slideContent(numericId,(subham_slideSpeed*-1));

		subham_activeId = false;

	}	

}



function slideContent(inputId,direction)

{

	

	var obj =document.getElementById('subham_a' + inputId);

	var contentObj = document.getElementById('subham_ac' + inputId);

	height = obj.clientHeight;

	if(height==0)height = obj.offsetHeight;

	height = height + direction;

	rerunFunction = true;

	if(height>contentObj.offsetHeight){

		height = contentObj.offsetHeight;

		rerunFunction = false;

	}

	if(height<=1){

		height = 1;

		rerunFunction = false;

	}



	obj.style.height = height + 'px';

	var topPos = height - contentObj.offsetHeight;

	if(topPos>0)topPos=0;

	contentObj.style.top = topPos + 'px';

	if(rerunFunction){

	

		setTimeout('slideContent(' + inputId + ',' + direction + ')',subham_timer);

	}else{

		if(height<=1){

			obj.style.display='none';

			if(objectIdToSlideDown && objectIdToSlideDown!=inputId){

				document.getElementById('subham_a' + objectIdToSlideDown).style.display='block';

				document.getElementById('subham_a' + objectIdToSlideDown).style.visibility='visible';

				slideContent(objectIdToSlideDown,subham_slideSpeed);				

			}else{

				subham_slideInProgress = false;

			}

		}else{

			subham_activeId = inputId;

			subham_slideInProgress = false;

		}

	}

}



function initShowHideDivs()

{

	var divs = document.getElementsByTagName('DIV');

	var divCounter = 1;

	var divCounter1 = 1;

	for(var no=0;no<divs.length;no++){

	//alert(divs[no].className)

		if(divs[no].className=='subham_question'){//alert(divs[no].className)

			divs[no].id = 'subham_q'+divCounter;

			var answer = divs[no].nextSibling;

			while(answer && answer.tagName!='DIV'){

				answer = answer.nextSibling;

			}

			answer.id = 'subham_a'+divCounter;	

			contentDiv = answer.getElementsByTagName('DIV')[0];

			contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px'; 	

			contentDiv.className='subham_answer_content';

			contentDiv.id = 'subham_ac' + divCounter;

			answer.style.display='none';

			answer.style.height='1px';

			divCounter++;

		}		

	}

}





function function1(value,id) 

{

	if(document.getElementById(id) != null)

	{	

		if(document.getElementById(id).checked == true)

		{

			var value1=window.confirm("Do You Want To Add This Symbol In Todays Pick?");

			//alert(document.getElementById(id).checked);

			if(value1==true)

			{

				window.location="pickerschoice.php?action=insert&compname="+value;

			}

			else

			{

				window.location="pickerschoice.php";

			}

		}

		else //if(document.getElementById(id).checked == false)

		{

			var value2=window.confirm("Do You Want To Delete This Symbol From Todays Pick?");

			//alert(document.getElementById(id).checked);

			if(value2==true)

			{

				window.location="pickerschoice.php?action=delete&compname="+value;

			}

			else

			{

				window.location="picksuggested_advisor.php";

			}

			

		}

	}

}

